USE [MarblesCMS]
GO
/****** Object:  Table [dbo].[Templates]    Script Date: 12/22/2009 16:39:33 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Templates](
	[templatename] [varchar](50) NOT NULL,
	[templatesourcepath] [varchar](255) NOT NULL,
	[themename] [varchar](255) NOT NULL,
	[title] [varchar](50) NOT NULL,
 CONSTRAINT [PK_Templates] PRIMARY KEY CLUSTERED 
(
	[templatename] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[TemplateContent]    Script Date: 12/22/2009 16:39:33 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[TemplateContent](
	[templatename] [varchar](50) NOT NULL,
	[contentid] [varchar](50) NOT NULL,
	[title] [varchar](255) NOT NULL,
	[editorheight] [int] NOT NULL,
 CONSTRAINT [PK_TemplateContent] PRIMARY KEY CLUSTERED 
(
	[templatename] ASC,
	[contentid] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[TaskStatus]    Script Date: 12/22/2009 16:39:33 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[TaskStatus](
	[taskstatusid] [tinyint] NOT NULL,
	[title] [varchar](50) NOT NULL,
 CONSTRAINT [PK_TaskStatus] PRIMARY KEY CLUSTERED 
(
	[taskstatusid] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[TaskPriority]    Script Date: 12/22/2009 16:39:33 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[TaskPriority](
	[taskpriorityid] [tinyint] NOT NULL,
	[title] [varchar](50) NOT NULL,
 CONSTRAINT [PK_TaskPriority] PRIMARY KEY CLUSTERED 
(
	[taskpriorityid] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[Task]    Script Date: 12/22/2009 16:39:33 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Task](
	[taskid] [int] NOT NULL,
	[username] [varchar](256) NOT NULL,
	[subject] [varchar](1000) NOT NULL,
	[taskstatusid] [tinyint] NOT NULL,
	[taskpriorityid] [tinyint] NOT NULL,
	[notes] [varchar](max) NOT NULL,
	[duedate] [datetime] NOT NULL,
	[startdate] [datetime] NOT NULL,
	[completiondate] [datetime] NULL,
 CONSTRAINT [PK_Task] PRIMARY KEY CLUSTERED 
(
	[taskid] ASC,
	[username] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[PageType]    Script Date: 12/22/2009 16:39:33 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[PageType](
	[pagetype] [varchar](50) NOT NULL,
	[title] [varchar](255) NOT NULL,
	[renderer] [varchar](255) NOT NULL,
	[renderertype] [varchar](255) NOT NULL,
	[editor] [varchar](255) NOT NULL,
 CONSTRAINT [PK_PageType] PRIMARY KEY CLUSTERED 
(
	[pagetype] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[PageContent]    Script Date: 12/22/2009 16:39:33 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[PageContent](
	[pageid] [varchar](50) NOT NULL,
	[contentid] [varchar](50) NOT NULL,
	[content] [varchar](max) NOT NULL,
 CONSTRAINT [PK_PageContent] PRIMARY KEY CLUSTERED 
(
	[pageid] ASC,
	[contentid] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[Page]    Script Date: 12/22/2009 16:39:33 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Page](
	[pageid] [varchar](50) NOT NULL,
	[templatename] [varchar](50) NOT NULL,
	[title] [varchar](255) NOT NULL,
	[description] [varchar](255) NOT NULL,
	[keywords] [varchar](255) NOT NULL,
	[parentpageid] [varchar](50) NOT NULL,
	[visible] [bit] NOT NULL,
	[pagetype] [varchar](50) NOT NULL,
	[anonymouscontent] [bit] NOT NULL,
 CONSTRAINT [PK_Page] PRIMARY KEY CLUSTERED 
(
	[pageid] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[BlogEntry]    Script Date: 12/22/2009 16:39:33 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[BlogEntry](
	[pagename] [varchar](50) NOT NULL,
	[ident] [varchar](40) NOT NULL,
	[title] [varchar](800) NOT NULL,
	[description] [varchar](max) NOT NULL,
	[publishdate] [date] NOT NULL,
	[author] [varchar](50) NOT NULL,
	[articlenumber] [int] NOT NULL,
 CONSTRAINT [PK_BlogEntry] PRIMARY KEY CLUSTERED 
(
	[pagename] ASC,
	[ident] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Default [DF_Templates_themename]    Script Date: 12/22/2009 16:39:33 ******/
ALTER TABLE [dbo].[Templates] ADD  CONSTRAINT [DF_Templates_themename]  DEFAULT ('') FOR [themename]
GO
/****** Object:  Default [DF_Templates_title]    Script Date: 12/22/2009 16:39:33 ******/
ALTER TABLE [dbo].[Templates] ADD  CONSTRAINT [DF_Templates_title]  DEFAULT ('') FOR [title]
GO
/****** Object:  Default [DF_TemplateContent_editorheight]    Script Date: 12/22/2009 16:39:33 ******/
ALTER TABLE [dbo].[TemplateContent] ADD  CONSTRAINT [DF_TemplateContent_editorheight]  DEFAULT ((25)) FOR [editorheight]
GO
/****** Object:  Default [DF_Page_description]    Script Date: 12/22/2009 16:39:33 ******/
ALTER TABLE [dbo].[Page] ADD  CONSTRAINT [DF_Page_description]  DEFAULT ('') FOR [description]
GO
/****** Object:  Default [DF_Page_keywords]    Script Date: 12/22/2009 16:39:33 ******/
ALTER TABLE [dbo].[Page] ADD  CONSTRAINT [DF_Page_keywords]  DEFAULT ('') FOR [keywords]
GO
/****** Object:  Default [DF_Page_parentpageid]    Script Date: 12/22/2009 16:39:33 ******/
ALTER TABLE [dbo].[Page] ADD  CONSTRAINT [DF_Page_parentpageid]  DEFAULT ('') FOR [parentpageid]
GO
/****** Object:  Default [DF__Page__visible__145C0A3F]    Script Date: 12/22/2009 16:39:33 ******/
ALTER TABLE [dbo].[Page] ADD  DEFAULT ((1)) FOR [visible]
GO
/****** Object:  Default [DF__Page__pagetype__182C9B23]    Script Date: 12/22/2009 16:39:33 ******/
ALTER TABLE [dbo].[Page] ADD  DEFAULT ('article') FOR [pagetype]
GO
/****** Object:  Default [DF__Page__anonymousc__1ED998B2]    Script Date: 12/22/2009 16:39:33 ******/
ALTER TABLE [dbo].[Page] ADD  DEFAULT ((1)) FOR [anonymouscontent]
GO
/****** Object:  Default [DF__BlogEntry__artic__1FCDBCEB]    Script Date: 12/22/2009 16:39:33 ******/
ALTER TABLE [dbo].[BlogEntry] ADD  DEFAULT ((1)) FOR [articlenumber]
GO
